<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind绑定style</title>
</head>

<body>
    <div id="app">
        <button @click='fontSize+=3'>点击文字加大</button>
        <div :style="{'color': color,'fontSize':fontSize+'em'}">文本</div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                color: 'red',
                fontSize: 1
            }
        })
    </script>
</body>

</html>